//
//  CustodyViewController.h
//  TourDeGarde
//
//  Created by Guillaume SOURDRILLE on 05/05/12.
//  Copyright (c) 2012 Astek. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Custody.h"
#import "DateUtils.h"
#import "MessageUtils.h"

@interface CustodyViewController : UIViewController<UIActionSheetDelegate, UITextFieldDelegate, UIAlertViewDelegate>{
    
    IBOutlet Custody *custody;
    BOOL isNew;
    IBOutlet UIActionSheet *actionSheetDateDebut;
    IBOutlet UIDatePicker *datePickerDateDebut;
    IBOutlet UIActionSheet *actionSheetDateFin;
    IBOutlet UIDatePicker *datePickerDateFin;
    IBOutlet UITextField *nameTextField;
}

@property (unsafe_unretained, nonatomic) IBOutlet UIButton *nameButton;
@property (unsafe_unretained, nonatomic) IBOutlet UIButton *beginDateButton;
@property (unsafe_unretained, nonatomic) IBOutlet UIButton *endDateButton;
@property (unsafe_unretained, nonatomic) IBOutlet UIButton *isActiveButton;
@property (unsafe_unretained, nonatomic) IBOutlet UIBarButtonItem *backButton;
@property (unsafe_unretained, nonatomic) IBOutlet UIBarButtonItem *saveButton;
@property (retain, nonatomic) IBOutlet UIActionSheet *actionSheetDateDebut;
@property (retain, nonatomic) IBOutlet UIDatePicker *datePickerDateDebut;
@property (retain, nonatomic) IBOutlet UIActionSheet *actionSheetDateFin;
@property (retain, nonatomic) IBOutlet UIDatePicker *datePickerDateFin;
@property (retain, nonatomic) IBOutlet UITextField *nameTextField;
@property (unsafe_unretained, nonatomic) IBOutlet UIButton *deleteButton;

@property (unsafe_unretained, nonatomic) IBOutlet UILabel *beginDateValue;
@property (unsafe_unretained, nonatomic) IBOutlet UILabel *endDateValue;
@property (unsafe_unretained, nonatomic) IBOutlet UILabel *isActiveValue;
@property (retain, nonatomic) IBOutlet Custody *custody;
@property (nonatomic, retain) DateUtils *dateUtils;
@property (nonatomic, retain) MessageUtils *messageUtils;
@property (unsafe_unretained, nonatomic) IBOutlet UILabel *titleValue;

-(IBAction) processRetour;
-(IBAction) processSave;
-(IBAction) setDateDebut;
-(IBAction) setDateFin;
-(IBAction) setPeriodeActive;
- (void)initParameters;
- (id)initWithCustody:(Custody *)param;
- (void)updateParameters;
- (IBAction)processDelete;

@end
